<?php

/**
 * KegiatanUks form.
 *
 * @package    alazhar
 * @subpackage form
 * @author     Ardhy Widodo
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class KegiatanUksForm extends BaseKegiatanUksForm {

    public function configure() {
        $this->widgetSchema['kategori_kegiatan_uks_id']->addOption('method', 'getKategori');
        $this->widgetSchema['daftar_bulan_list']->addOption('method', 'getBulan');
        $this->widgetSchema['daftar_bulan_list']->setOption('expanded', true);
        $years = array();
        for ($a = date('Y') - 5; $a <= date('Y') + 5; $a++) {
            $years[] = $a;
        }
        $this->widgetSchema['tahun_awal'] = new sfWidgetFormSelect(array('choices' => array_combine($years, $years), 'default' => date('Y')));
        $this->widgetSchema['tahun_akhir'] = new sfWidgetFormSelect(array('choices' => array_combine($years, $years), 'default' => date('Y')+1));
        $this->widgetSchema->setLabels(array(
            'nama' => 'Kegiatan',
            'kategori_kegiatan_uks_id' => 'Kategori'
        ));
    }

}
